<template>
	<view class="Lu-good-box">
		<view class="Lu-good-header">
			<image src="../../static/image/good/good_bg.png"></image>
		</view>
		<view class="Lu-good-lists">
			<view class="Lu-good-listitem" v-for="(item,index) in goodsList" :key="index" @click="navTo(item)">
				<view class="Lu-good-itemimg">
					<image :src="apiUrl + item.pic"></image>
				</view>
				<view class="Lu-good-iteminfor">
					<view class="Lu-good-iteminforname">{{item.title}}</view>
					<view class="Lu-good-iteminforjie">项目简介:{{item.describe}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default{
		computed: {
			...mapState(['hasLogin','userInfo','openId','apiUrl','tabbarid'])
		},
		data(){
			return{
				goodsList:[]
				
			}
		},
		onLoad:function(){
			uni.request({
				url:this.apiUrl+ 'api/good_article',
				data:{
					page:'',
					limit:''
				},
				method:'POST',
				success: (res) => {
					console.log(res.data.data)
					this.goodsList = res.data.data
				}
			})
		},
		methods:{
			navTo:function(item) {
				uni.navigateTo({
					url: `/pages/good/lists?id=${item.id}`
				})
			},
		}
	}
	
</script>

<style lang="scss">
	page{
		background-color: #f5f5f5;
	}
	.Lu-good-box{
		padding: 0 40rpx;
	}
	.Lu-good-header{
		width: 670rpx;
		height: 120rpx;
		image{
			width: 670rpx;
			height: 120rpx;
		}
	}
	.Lu-good-lists{
		.Lu-good-listitem{
			margin-top: 30rpx;
			.Lu-good-itemimg{
				image{
					width: 670rpx;
					height: 360rpx;
					border-radius: 20rpx;
				}
			}
			.Lu-good-iteminfor{
				padding: 0 20rpx;
				margin-top: 20rpx;
				.Lu-good-iteminforname{
					font-size: 36rpx;
					color: #333333;
				}
				.Lu-good-iteminforjie{
					font-size: 24rpx;
					color: #666666;
					margin-top: 10rpx;
					width: 540rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
			}
		}
		
	}
</style>
